import Vue from "vue"
import Router from "vue-router"

//這裏導入可以讓用戶訪問的組件

Vue.use(Router);
import Home from "../components/Home"
import Login from "../components/Login"
import Register from "../components/Register"
import FindPassword from "../components/FindPassword"
import ResetPassword from "../components/ResetPassword"
import Write from "../components/Write"
import Writed from "../components/Writed"
import Article from "../components/Article"
import Wallet from "../components/Wallet"
export default new Router({
  //設置路由模式爲history 去掉默認的#
  mode:"history",
  routes:[
    //路由列表
    {
      name:"Home",
      path:"/",
      component:Home,
    },
    {
      name:"Home",
      path:"/home",
      component:Home,
    },
    {
      name:"Login",
      path:'/login',
      component:Login,
    },
    {
      name:"Login",
      path:'/user/login',
      component:Login,
    },
    {
      name:"Register",
      path:"/register",
      component:Register
    },
    {
      name:"Register",
      path:"/user/register",
      component:Register
    },
    {
      name:"FindPassword",
      path:"/find_password",
      component:FindPassword
    },
    {
      name:"ResetPassword",
      path:"/reset_password",
      component:ResetPassword
    },
    {
      name:"Write",
      path:"/write",
      component:Write,
    },
    {
       name:"Writed",
       path:"/:id/writed",
       component: Writed,
     },
     {
       name:"Article",
       path:"/article/:id",
       component: Article,
     },
      {
       name:"Wallet",
       path:"/user/wallet",
       component: Wallet,
     },
  ]
})
